/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * WiFiAdaptorGUI.java
 *
 * Created on Feb 25, 2012, 11:55:41 PM
 */
package GUI;

import Controller.Controller;
import Controller.RTMeasurements;
import jWASA.Sensor;
import jWASA.SensorEKG;
import java.awt.Checkbox;
import java.awt.Component;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TooManyListenersException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JCheckBox;

/**
 *
 * @author gianmariospacagna
 */
public class WiFiAdaptorGUI extends javax.swing.JFrame {

    Controller controller;
    //HashMap<Sensor, RTMeasurements> rtMeasurements;
    HashMap<Sensor, Boolean> sensorStatus;
    RTMeasurements rtMeasurements;
    Sensor sensorEKG;

    /** Creates new form WiFiAdaptorGUI */
    public WiFiAdaptorGUI() {
        initComponents();
    }

    public WiFiAdaptorGUI(Controller controller) {
        this();
        this.controller = controller;
        //rtMeasurements = new HashMap<Sensor, RTMeasurements>();

        sensorStatus = new HashMap<Sensor, Boolean>();


        sensorStatus.put(sensorEKG, false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPopupMenuAlert = new javax.swing.JPopupMenu();
        jPopupMenu1 = new javax.swing.JPopupMenu();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jTextFieldWASAPort = new javax.swing.JTextField();
        jTextFieldServerAddr = new javax.swing.JTextField();
        jTextFieldServerPort = new javax.swing.JTextField();
        jButtonSave = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jButtonStartRT = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jButtonStop = new javax.swing.JButton();
        jPanelAnInputs = new javax.swing.JPanel();
        jCheckBox0 = new javax.swing.JCheckBox();
        jCheckBox1 = new javax.swing.JCheckBox();
        jCheckBox2 = new javax.swing.JCheckBox();
        jCheckBox3 = new javax.swing.JCheckBox();
        jCheckBox7 = new javax.swing.JCheckBox();
        jCheckBox4 = new javax.swing.JCheckBox();
        jCheckBox5 = new javax.swing.JCheckBox();
        jCheckBox6 = new javax.swing.JCheckBox();
        jLabel6 = new javax.swing.JLabel();
        jTextFieldRate = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabelAlert = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("WASA Port:");

        jLabel2.setText("Server Address:");

        jLabel3.setText("Server Port:");

        jTextFieldWASAPort.setText("/dev/tty.usbserial-A4UUYVZS");
        jTextFieldWASAPort.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldWASAPortActionPerformed(evt);
            }
        });

        jTextFieldServerAddr.setText("localhost");

        jTextFieldServerPort.setText("2012");

        jButtonSave.setText("Save");
        jButtonSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSaveActionPerformed(evt);
            }
        });

        jLabel4.setText("JWasa Client GUI");

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(37, 37, 37)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel1)
                            .add(jLabel3)
                            .add(jLabel2))
                        .add(36, 36, 36)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jTextFieldServerPort, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
                            .add(jTextFieldServerAddr, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
                            .add(jTextFieldWASAPort, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap(225, Short.MAX_VALUE)
                        .add(jButtonSave))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(76, 76, 76)
                        .add(jLabel4)))
                .add(46, 46, 46))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 44, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(46, 46, 46)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(jTextFieldWASAPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jTextFieldServerAddr, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel2))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jLabel3)
                    .add(jTextFieldServerPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jButtonSave)
                .addContainerGap())
        );

        jButtonStartRT.setText("Start RT Streaming");
        jButtonStartRT.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonStartRTActionPerformed(evt);
            }
        });

        jLabel5.setText("Sensors Controller");

        jButtonStop.setText("Stop");
        jButtonStop.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonStopActionPerformed(evt);
            }
        });

        jCheckBox0.setText("0");
        jCheckBox0.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox0ActionPerformed(evt);
            }
        });

        jCheckBox1.setText("1");

        jCheckBox2.setText("2");
        jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox2ActionPerformed(evt);
            }
        });

        jCheckBox3.setText("3");

        jCheckBox7.setText("7");

        jCheckBox4.setText("4");
        jCheckBox4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox4ActionPerformed(evt);
            }
        });

        jCheckBox5.setText("5");

        jCheckBox6.setText("6");

        org.jdesktop.layout.GroupLayout jPanelAnInputsLayout = new org.jdesktop.layout.GroupLayout(jPanelAnInputs);
        jPanelAnInputs.setLayout(jPanelAnInputsLayout);
        jPanelAnInputsLayout.setHorizontalGroup(
            jPanelAnInputsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanelAnInputsLayout.createSequentialGroup()
                .add(jPanelAnInputsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanelAnInputsLayout.createSequentialGroup()
                        .add(jCheckBox0)
                        .add(34, 34, 34)
                        .add(jCheckBox1)
                        .add(26, 26, 26)
                        .add(jCheckBox2))
                    .add(jPanelAnInputsLayout.createSequentialGroup()
                        .add(jCheckBox4)
                        .add(34, 34, 34)
                        .add(jCheckBox5)
                        .add(26, 26, 26)
                        .add(jCheckBox6)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 34, Short.MAX_VALUE)
                .add(jPanelAnInputsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jCheckBox3)
                    .add(jCheckBox7)))
        );
        jPanelAnInputsLayout.setVerticalGroup(
            jPanelAnInputsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanelAnInputsLayout.createSequentialGroup()
                .add(jPanelAnInputsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanelAnInputsLayout.createSequentialGroup()
                        .add(jPanelAnInputsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jCheckBox0)
                            .add(jCheckBox1)
                            .add(jCheckBox2))
                        .add(18, 18, 18)
                        .add(jPanelAnInputsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jCheckBox4)
                            .add(jCheckBox5)
                            .add(jCheckBox6)))
                    .add(jPanelAnInputsLayout.createSequentialGroup()
                        .add(jCheckBox3)
                        .add(18, 18, 18)
                        .add(jCheckBox7)))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel6.setText("Analog Inputs:");

        jTextFieldRate.setText("4");
        jTextFieldRate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldRateActionPerformed(evt);
            }
        });

        jLabel7.setText("Rate:");

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2Layout.createSequentialGroup()
                        .add(126, 126, 126)
                        .add(jLabel5))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addContainerGap(339, Short.MAX_VALUE)
                        .add(jButtonStop))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
                        .add(178, 178, 178)
                        .add(jButtonStartRT, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE))
                    .add(jPanel2Layout.createSequentialGroup()
                        .add(46, 46, 46)
                        .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel2Layout.createSequentialGroup()
                                .add(jLabel7)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jTextFieldRate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 72, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jLabel6)
                            .add(jPanelAnInputs, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(jLabel5)
                .add(34, 34, 34)
                .add(jLabel6)
                .add(18, 18, 18)
                .add(jPanelAnInputs, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel7)
                    .add(jTextFieldRate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(28, 28, 28)
                .add(jButtonStartRT)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 40, Short.MAX_VALUE)
                .add(jButtonStop)
                .addContainerGap())
        );

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabelAlert.setText(" ");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(31, 31, 31)
                        .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(layout.createSequentialGroup()
                        .add(68, 68, 68)
                        .add(jLabelAlert)))
                .add(2, 2, 2)
                .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(36, 36, 36)
                        .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jLabelAlert))
                    .add(layout.createSequentialGroup()
                        .addContainerGap()
                        .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 344, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(layout.createSequentialGroup()
                        .addContainerGap()
                        .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextFieldWASAPortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldWASAPortActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldWASAPortActionPerformed

    private void jButtonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveActionPerformed

        try {
            jLabelAlert.setText(" ");
            controller.setPort(jTextFieldWASAPort.getText());
            try {

                controller.setServerLocation(jTextFieldServerAddr.getText());
            } catch (UnknownHostException ex) {
                Logger.getLogger(WiFiAdaptorGUI.class.getName()).log(Level.SEVERE, null, ex);
                jLabelAlert.setText("Unknown Server Location");
            }
            controller.setServerPort(jTextFieldServerPort.getText());

        } catch (Exception e) {
            jLabelAlert.setText("Some error occured");
            Logger.getLogger(WiFiAdaptorGUI.class.getCanonicalName()).log(Level.SEVERE, null, e);
        }

    }//GEN-LAST:event_jButtonSaveActionPerformed

    private void jButtonStartRTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonStartRTActionPerformed


        Set<Sensor> sensors = new HashSet<Sensor>();
        /*
         *         Boolean isEKGOn = sensorStatus.get(sensorEKG);
        
        if (jCheckBoxLight.isSelected()) {
        sensors.add(new Sensor("LIGHT", "Light Sensor", 3, 1));
        }
        if (jCheckBoxTemperature.isSelected()) {
        sensors.add(new Sensor("TEMPERATURE", "Temperature Sensor", 4, 1));
        }if (jCheckBoxEKG.isSelected()) {
        sensors.add(new Sensor("EKG", "EKG Sensor", 2, 1));
        }*/

        /*
        if (isEKGOn == false) {
        isEKGOn = true;
        rtMeasurements.put(sensorEKG, controller.startMonitoring(sensorEKG));
        jButtonStartRT.setText("Stop EKG");
        } else {
        isEKGOn = false;
        rtMeasurements.get(sensorEKG).stopMonitoring();
        rtMeasurements.remove(sensorEKG);
        jButtonStartRT.setText("Start EKG");
        }
        
        
        
        
        } catch (Exception e) {
        jLabelAlert.setText("Some error occured: ");
        Logger.getLogger(WiFiAdaptorGUI.class.getCanonicalName()).log(Level.SEVERE, null, e);
        }*/

        for (Component c : jPanelAnInputs.getComponents()) {
            if (c instanceof JCheckBox) {
                JCheckBox cb = (JCheckBox) c;
                if (cb.isSelected()) {
                    try{
                    //System.err.println("cb.getText()='"+cb.getText()+"'");
                        sensors.add(new Sensor("AN" + cb.getText(), "Analog Input " + cb.getText(), Integer.parseInt(cb.getText()), 1));
                    }catch (NumberFormatException e){
                        e.printStackTrace();
                    }
                }
            }
        }
        try {
            rtMeasurements = controller.startMonitoring(sensors,Integer.parseInt(jTextFieldRate.getText()));

        } catch (TooManyListenersException ex) {
            Logger.getLogger(WiFiAdaptorGUI.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_jButtonStartRTActionPerformed

    private void jCheckBox0ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox0ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCheckBox0ActionPerformed

    private void jButtonStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonStopActionPerformed
        if (rtMeasurements != null) {
            rtMeasurements.stopMonitoring();
        }
    }//GEN-LAST:event_jButtonStopActionPerformed

    private void jCheckBox4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCheckBox4ActionPerformed

    private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCheckBox2ActionPerformed

    private void jTextFieldRateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldRateActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldRateActionPerformed

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonSave;
    private javax.swing.JButton jButtonStartRT;
    private javax.swing.JButton jButtonStop;
    private javax.swing.JCheckBox jCheckBox0;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JCheckBox jCheckBox2;
    private javax.swing.JCheckBox jCheckBox3;
    private javax.swing.JCheckBox jCheckBox4;
    private javax.swing.JCheckBox jCheckBox5;
    private javax.swing.JCheckBox jCheckBox6;
    private javax.swing.JCheckBox jCheckBox7;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabelAlert;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanelAnInputs;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JPopupMenu jPopupMenuAlert;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextField jTextFieldRate;
    private javax.swing.JTextField jTextFieldServerAddr;
    private javax.swing.JTextField jTextFieldServerPort;
    private javax.swing.JTextField jTextFieldWASAPort;
    // End of variables declaration//GEN-END:variables
}
